[fix] free all the memory