made changes to if statement