bug fix - code now kills properly