bug fix & efficiency upgrade