Added catch for index out of bounds exceptions
Instead of recursively building hierarchy path on call, path is built
with hiearchy