fix a bug in commit and the test... should be more careful next time