Added support for external hooks