Preferences now gets data from database