Modifying the date display and adding safeguard code