fix bug for entity not exists