fixed a bug in GCollect()