fix several bug