Added error event callback