Remove cur_pos global variable