added support for 0 size packets