Added fix for last package
Fix 2 for end packets