fix confirm function