bug fixed and test suite