fixed a bug with date formatting