addded confirm button function