clean up and change leader