add userAction() function for mocha tests