Fixed error with the handling expected packet size