add getEntityInstance method
use getEntityinstance method
clear Invalid reference