fixed some memory-related issues