added the possibility to customize max allowed packet