Hack to add support for dynamic segments

Props to @stevenwilkin