Fixed an array index OOB exception on line 27