some bugs fixed.