fix auth procedure