fixed bug where ['userName'] was being passed instead of  equivalent
added docblock