add some more testing and fix an issue