Adding hangup and error handlers