fix#1 index out of bounds exception