Cast bug fixed

Cast bug fixed