Revert "reverted back to file-only checks, changed to file_exists()"

This reverts commit d234b8e2128356a5d7c76e7d7048c21a26bd49c2.