added method to set messaging handler