fixed bug of auto offset