add user login and lougout function