start monitoring code