working on mem_CopySafe