Fixing export of state