complete loadconfig func