fixed order of sending view and assigning variables