fixed redirect loop on index