Change variable and remove anonymous function