adding listener to debug output