Fixed the double packet bug thanks to @cpw