add delete upstream function