login/register functionality almost working