Fixing states cache problem