fix bug for not resetting metadata