Changed Exception thrown by threshold to an IllegalStateException