Replaced open() with io.open()