Fixed so that metadata is saved when uploading files to server