changed login logic again