Preference is now using prefwindow (tested)
Never store the password in a global variable, only use function parameter...