fixed crash when opening the preferences dialog