Made preferences window dynamic