fix closure bug