working login/logout/register