bug fix, code improve