safer check for command