fix register and login failed error message display issue