fix several bugs w.r.t. theta
modify updata_theta