added support for custom urlRegex