fixed the 'memory leak'