fixing leaks (but is TOO SLOWWW)
changes