memory-alloc-bug fixed