Added handling for empty start date and end date