Fixed bug calling to datetime on nil - replaced with try(:to_datetime)