Fix try/except in check_command