adding the logic to redirect to 404 page