correcting if statement