Modified to switch site from preferences.