added user authentication and login/logout funtion