fixed an if/else issue