-fix crashing by double checking preferences