fixing typecast warning