add more error hanlding to Command methods