Since CMD is a common datastore option around metasploit, for example used in msf payloads, I would suggest to use another variable name here to avoid confusion, for example, NRPECMD