moved main ahead of config