memory leak fixed: problem with matplotlib figure generation