Added a login function