fixing if condition