fix one of the TODOs and add test case