profile.export()
            .pipe(fs.createWriteStream(filepath))
            .on('error', function(error) {
                profile.delete();
                reject(error);