fix legacy problem for entity