refactored 404 routing