Add end condition