adjust some places which may cause bugs.