json metadata file was being written in the wrong place