fix mistake of not checking both parts in