added tool change logic