Memory management issues solved