[IMP]Improved code and stop the testcases