fix a memleak, fix a dbg message, add a dbg message