fixed the NSM object error (??) and set code for WPS run.