ensure redirect loop does not occur