fixing KILL thread bug