sql offset fix #504

fix model offset #504