typecast bug fixed