I've added a check at the beginning of the command.