fixing up config, and adding some debug logging