logging + put back some things lost in the merge