fixed wrong reference of entity objects