fix a bug and add gc