Check correct value in if statement