fixed *massive* memleak