create hook automatically