add a judgement for set_position