wraps rename-command in an if statement