debug messaging improved