added error event cancelling to demo app