realloc working