cmd error checking.