fix double free
insert assertions