added new check cmd function.