performance turing and bug fix