purity check fixed