fixed a bug where the same file was opened multiple times, if it would be opened from treeview and from menu afterwards.