fixed offset, fixed memory leak