Fixed error caused by redirect after login in the server.