fix a bug when we receive multiple packages to the same buffer