fix some memory leaks and map starting tracking point