adding timestamp check
fixing a bug with the date check