Fix importing and exporting files - check if opened/closed, for openning
closings