fixed illegal memory access
Merge pull request #24 from JulianSchmid/master

fixed illegal memory access