improved 404 handling