Added error event handlers