Revert "corrected memory errors"

This reverts commit 8ca2b3e05076eb5057cb00ec04e45d70565fe17b.