fix bug as offset