added an if statement