memory bug fix