improved packet condition checks and removed superfluous try blocks