added an if-else statment