Fixed the confirm functionality