fixed the hook for new dir hierarchy