fixing conditional statement