fixing id empty value in saveData function