updated todo, fixed memleak