Fix read next packet

Improve extracting process from InputFile
Done in PR #15