raw version of outline
fix memory leak bug