Bugfix to messageHandler