fixed transform_entities bug