Fixed an error in packet logic; still not working right