updated with user preference on database connection