Add checks for path exists and return the path set