fix a bug with date