fixes memory loss in test