fix offset bug in returned data