fixes casting issue