fixed realloc. added update callback