Fixed if statement issue