fixed bug with login redirect