fixed config lookup. added some logs