fixed doublefree bug