[MAJIR] fix bug in variable management.