checkpoint; fix resource leak