Bug fixed and performance improvement