Added writing of config