fix a bug with editing then creating a media