Improve file opening when matching links