fix big resource leak