fixup a memory bug