Use pathRegex
Fix bug, it won't work after reload