Fix bug in HCF middleware, code to detect duped urls wasn't working correctly