Fixing problem of missing user name in client

This is a better version of the previous pull request, using userId to find the user rather than email.