added setvariable method to mainscreen