add some debug logging and wrapper