Window Close Bug fixed