fixed crash when rotating during login/register by replacing the constructor with a static newinstance method