added more debug logging