Trying to fix memleak