fix bug in ctr