fix errors (now states run without errors)