add login/register logic