loading tags when open a file and saving when close tab