support event handling with MVar listener, various fixes