set path from query instead of calling on creation of menu