fixed indexing error in gp