fix bug of monitoring and update doctest