make closure and bug fix