more debug logic