fix many bugs & adjust some param