fix bug which caused all media objects to be erased instead of current one