Fixed bug in monitoring