cleaned up kill script logic