adding login function