added users to database and created a login function