Fixes redirect loop