Add support for (optional) invalid callbacks