added terminate to worker