use process.exit(1) instead of return and check file existence