changed javascript of the settings page to work properly with ajax calls