EntityRegistry fixed weird code bug