Fixed bug with incorrect refreshing of the user