use terminate instead of kill