used platform independent path separator Path.DirectorySeparatorChar. Clicking the Generate button repeatedly doesnot crash applciation.