need to fix the bug in last window