Bug fix for if any date undefined