fixed casting issue