release streams when stuff goes wrong, handle errors