Add re-open functionality and run file detection