add login logic code