clean up, and fix loading config at startup