Bug fixed; memory optimize