fix domains and vectorize states