hopefully fixed redirect loop