fix bug where index was not incremented
go fmt