I think this causes an issue. The existence check should be before the process function.