safe memory management function
using for debug print macro
new testing files