re-fix array index problem by increasing array size