correctly remove observers, when window is closing