Fixing bugs with building reply packet