Fix sending code