added some more debug messages to trace down a problem