Add checks for null dates