Adding sanity check for nil dates