Fixed bugs on win: crashed when clicked