fixed bug with packets of length 4 not being correctly read