fix memory management of Tracks