fixed srcIndex and maxsrcIndex issue