small fix in when saving date