Fixed bug with redirect hook on leaf routes