thread leaking fixed