fixed a bug resulting in oversized messages