sanity check to prevent DoS attacks