automatic end date setting on status change