fix: prevent memory leak