fixed an if statment