Fixed errors in receiving data from the server