included logic for registration and the login/register pages