fixed bug in confirmation function