Added msghandler
Use msghandler