rewrite isInsidePath