#7 forgot that we already had self.window, changed it to preferencesWindow