fixing if expression