example for async prehooks