The effect of generating errors on subsequent learning and generalization