error checking in login/register