wrote method to save metadeta, needs to be tested