add some more debug logic