added debug logging to trace log