fix memory leaks, improve UI on device