Fix polymorphic id issue