fix offset out of bound error
Merge pull request #547 from teharrison/develop

fix offset out of bound error