updated if statement