include some code for memory manage