clean up memory in minimal demo