add memory verification