Add size-checking for maximum message size