found some more places where I should explicitly clear up memory in order to avoid security issues