adds StateError exception