packet retreival bug fix: when pkt is null
Bug in packet prepare in debugging output