Proper error handling with 404 page