check if job is valid and clean it