receive_data()

fix bugs in receive_data()