prepent end append

and more testes