fixup logic in dao based on testing error case