added checking of message integrity