fixed mistake in hook.js