taking care of an if statement problem