fixed bug found with offset