Fix deleting media error