system cleanup after finishing last loop