fixing small thread issue