simulation typecast error fix