implemented handshake error, changed confirm emit to confirm.success and confirm.error