Added path helper and redirect function