hook automatically