fix: some memory leaks