Added the possibility to enable or disable monitoring.