changed an if that should have been an else if