Update with new function for file exists checking.