fix closure issue