fixed bug with entity id