fixed bug which could cause a crash due to an array index overflow