bugfix and date formatting treatment