Add variable declarations and assignments to the save Button