fixing a bug in auth_mode change