Fixed bug in receiving data.