fixed redirect loop during login