corrected typecast