bug fix closure