minor correction for an undefined id in the save function