Fixing if statement