Fix for nil dates
Added logging