Fixed exception inside exception handler

-fixed exception handler which was throwing an exception itself (cast exception) when failing to send a message