Better implementation for packet length limitations