fix threading issue on monitor test