Bug fix for add metadata to a file