fixing bug in ctl script