terminate more gracefully