state validity tested. handle linking error