fixed the closure issue