Fix crash when the monitor is off.

Determin whether the monitor is on in worker and client.