OnMessage function creates implicit monitor which receives the task message and calls your anonymous function. Same goes for OnTerminated.
If you wish to use MonitorWith, you should implement message processing and termination handling as a monitor events, not with OnMessage/OnTerminated functions.