fix a dumb realloc bug