add window monitor. Fix opened/closed flash.