removed memory bug