Fix in receive_data function