use lock statement instead of Monitor.