fix error and test