remove memory leak from echo