as discussed this would puck up something like '/a/b/c/d/e/foo'
so this has been fixed by ensuring the pattern ends with a '/' for the test