fixed offset bug