fixed bug on adding entity