Moved getVocabs in the hook if block so it runs only when it's needed.