fixed ridiculous memory leak