Fixed bug with sub_end_date