fix somes bugs due to a bad life cycle using.