implement hook