moved check cmd to utils