bug fixed and test files added