orrected typo that broke script: "ilename" should be "filename".