fix bug with login procedure