[INTERNAL] index error fixed in getPeakIndex()