Fixing retrieve metastate bug