fix for nil date