fixed debug logging