fix bug on redirect after login