Finished revising code for proper redirect from a 404 page.