Revert "fix some memory problems"

This reverts commit a7a2972a27e72db142575536819a0b7e0959ffbb.