fixed bug where new task could have invalid end date