fix bug when enabling monitoring for the first time