check if file exists before creating cfg