Bugfix - index out of range - take 2