fix #1 - index out of range
fix #1 for good