- fixed bug in memory reallocation