fixed issue with db iterator