Added a check to determine if we have a monitor to dispose.

#2528