fixed msg loop: exceptions thrown from state factory