closing file before creating the data binding, also modified script a bit