fixed a null.replace error when login fails