hack-patch for error handling