fixed bug when adding states that dont exist yet