sql offset fix #504

fix model offset #504
Merge pull request #505 from xboston/patch-1

sql offset fix #504