minor changes in debugging and logging