fixed casting assignment