need to allocate page-locked memory properly
comment debug code
check errors only when debug is on