Added window closed event