changed sanity check upper limit to 1000