add license comment
fix memory leak(s)