add return code check for execCmd()