guard new function with mem checkpoint macro