changed casting method