trying to solve event bug in windows