Refactor errCB
Make sure bytes are placed on the heap