login logic fixed