several bug fixed