fixing if statement