Bug fix when date is null