Fixed bug with incorrect refreshing of the user

This is the proposed fix for the issue #602