fix with memory manage