implement fixing up status and properly closing threads as of now it eats away all available resources and makes the system unstable.