fixed bug in if statement