fixing grep in check_cmd