use require instead of stat as per jaredly comment