tunning testcase and bug fix