fixed index out of bound error
Merge pull request #15 from magnetsystems/jim_dev

fixed index out of bound error