only insert config if the layer was correctly generated, fixes #336