more sophisticated 404 check