fix minor bug and optimize