Development

fix error when config dict is null. 
added principal exists. 

All unit-tests pass.