Bug in confirmation email code