Added type casting for assignment