fixed error
Added login/logout/register functionality