Fixed an index out of bound in genetareMainFile()