fixing bug:if first packet is from server, all packets order was inverted