fixed some message processing problems