fix memory leak
add end to end test to the travis ci