handle hooks exceptions