bug fixes, thread stoppage