Replaced a second instance of open()