double free fixed, this was non-trivial