escape messages correctly