fix late state initialization bug