added a kill function