added debug logging statements