Variables loading function corrected