adding login function and salt