add more tests and fix adapter