bugfix in message handling