changed from scala vars to rx Var